package ws;

import java.util.ArrayList;
import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

@WebService(serviceName = "BanqueWS")
public class BanqueService {

	@WebMethod(operationName = "conversionEuroDH")
	public double conversion(@WebParam(name = "montant") double mnt) {
		return mnt * 11.3;
	}

	@WebMethod
	public String test() {
		return "Test";
	}
	
	@WebMethod
	public Compte consulterCompte(@WebParam(name = "code") int code) {
		return new Compte(1, Math.random() * 8000);
	}
	
	@WebMethod()
	public List<Compte> listeComptes() {
		List<Compte> cptes = new ArrayList<Compte>();
		cptes.add(new Compte(1, Math.random() * 8000));
		cptes.add(new Compte(2, Math.random() * 8000));
		cptes.add(new Compte(3, Math.random() * 8000));
		return cptes;
	}
}
